1. Field of the Invention
The present invention relates to a technique of detecting the motion vector of a moving image to correct blurring of the moving image.
2. Description of the Related Art
An image capturing apparatus such as a video camera which captures a moving image suffers image blurring owing to camera shake when the lens zooms to the telephoto end. To prevent image blurring caused by camera shake, there has conventionally been proposed a technique of detecting the motion vector of an image from a captured image signal and correcting image blurring on the basis of the motion vector.
Known examples of the conventional method of detecting the motion vector of a moving image are a correlation method based on correlation calculation, and block matching.
According to block matching, an input image signal is divided into a plurality of blocks (e.g., eight pixels×eight lines) of a proper size. Differences from pixels in a predetermined range of a preceding field (or frame) are calculated for each block. A block of a preceding field (or frame) in which the sum of the absolute values of the differences becomes minimum is searched for. The relative shift between frames represents the motion vector of the block.
Matching calculation is discussed in detail in Morio Onoe, et al., “Information Processing”, Vol. 17, No. 7, pp. 634-640, July 1976.
An example of a conventional motion vector detection method using block matching will be explained with reference to FIG. 6. FIG. 6 is a schematic block diagram of an apparatus which prevents blurring according to a conventional motion vector detection method.
An image signal (field or frame) subjected to motion vector detection is input to an image memory 15 and a filter 102 for extracting the spatial frequency. The image memory 15 temporarily stores the image signal. The filter 102 extracts, from the image signal, a spatial frequency component useful for motion vector detection. That is, the filter 102 removes the low and high spatial frequency components of the image signal.
The image signal having passed through the filter 102 is input to a binarization circuit 103. The binarization circuit 103 binarizes the image signal using zero level as a reference. More specifically, the binarization circuit 103 outputs the sign bit of the output signal.
The binary image signal is input to a correlation calculation circuit 104 and a memory 105 serving as a 1-field period delay means. The correlation calculation circuit 104 further receives an image signal of a preceding field from the memory 105.
The correlation calculation circuit 104 calculates the correlation between the current and preceding fields for each block according to block matching, and outputs the resultant correlation value to a motion vector detection circuit 106. The motion vector detection circuit 106 detects the motion vector of each block from the correlation value. More specifically, the motion vector detection circuit 106 searches for a block of a preceding field having a minimum correlation value. The motion vector detection circuit 106 detects the relative shift between the blocks of the current and preceding fields as a motion vector.
The motion vector of each block is input to a motion vector determination circuit 107. The motion vector determination circuit 107 determines the motion vector of an entire image from the motion vectors of respective blocks. More specifically, the motion vector determination circuit 107 determines the median or average of motion vectors of respective blocks as the motion vector of the entire image. At this time, the motion vector determination circuit 107 evaluates the motion vector of each block on the basis of the correlation value, determining whether the motion vector of the block is valid/invalid. By determining the number of valid/invalid motion vectors, the reliability of the motion vector can be evaluated.
The motion vector determination circuit 107 outputs the motion vector of the entire image to a memory read control circuit 22. The memory read control circuit 22 controls the read position in the image memory 15 so as to cancel image blurring in accordance with the motion vector of the entire image. Then, the image memory 15 outputs a blurring-corrected image signal.
A motion vector evaluation method will be explained.
FIG. 7 is a flowchart for explaining the motion vector evaluation method.
In step S1001, the motion vector of each block is acquired. In step S1002, the minimum value of the correlation value of each block is acquired. In step S1003, it is determined whether the minimum value of the correlation value acquired in step S1002 is larger than an arbitrary constant A. If it is determined in step S1003 that the minimum value is larger than A, the process advances to step S1004. If it is determined in step S1003 that the minimum value is equal to or smaller than A, the process advances to step S1005. In step S1004, the motion vector of the target block is invalidated. In step S1005, it is determined whether all blocks have been processed. If not all blocks have been processed, the process shifts to the next block and is repeated from step S1001. If all blocks have been processed, the process advances to step S1006. In step S1006, a valid motion vector is output.
Japanese Patent Laid-Open No. 6-203164 proposes a method of increasing the motion vector detection precision by evaluating the reliability of the motion vector in a system which corrects image blurring by detecting the motion vector of an image.
However, according to the conventional technique, if it is determined that the number of valid motion vectors is smaller than a predetermined value, i.e., the reliability of detected motion vectors is poor, the motion vectors are invalidated not to execute blurring correction. At this time, the motion vector reliability is influenced by the image state. That is, a motion vector of high reliability can be detected from a high-contrast image for which matching is uniquely determined. However, when an image has few characteristic patterns or includes many similar features, a motion vector of low reliability is detected.
Even while the same object is captured, the motion vector reliability always changes owing to the image flow caused by camera shake, the out-of-focus state upon moving the focus, or the like. If execution/non-execution of blurring correction is simply determined in accordance with the motion vector reliability, execution and non-execution of blurring correction are continuously repeated, resulting in a discontinuous anti-shake effect.